package com.xinzhidi.web.task;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xinzhidi.common.constant.AgreementConstants;
import com.xinzhidi.web.alarmSetting.service.AlarmSettingService;
import com.xinzhidi.web.dtuusr.service.DtuUsrService;
import com.xinzhidi.web.equipment.domain.Equipment;
import com.xinzhidi.web.equipment.service.EquipmentService;
import com.xinzhidi.web.equipmentAlarm.service.EquipmentAlarmService;
import com.xinzhidi.web.netty.service.DeviceInstructionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 平均数定时任务
 *
 * @author cx
 */
@Component("avgTask")
public class AvgTask {

    @Autowired
    private DeviceInstructionService deviceInstructionService;

    @Autowired
    private DtuUsrService dtuUsrService;

    @Autowired
    private AlarmSettingService alarmSettingService;

    @Autowired
    private EquipmentService equipmentService;

    @Autowired
    private EquipmentAlarmService equipmentAlarmService;

    public void ryNoParams() {

        List<Equipment> equipmentList = equipmentService.list(new LambdaQueryWrapper<>(Equipment.class)
                .eq(Equipment::getDelFlag , AgreementConstants.DEL_FLAG_NO));
        //获取每个层级（除了住户）外没有设备的数据，计算平均数存到历史记录表中
        this.avgPlot(equipmentList);


    }

    /**
     * 插入楼栋没有阀门表（或热量表或室温采集器）的历史数据
     * @author cx
     * @date 2023/10/13 18:33
     **/
    private void avgPlot(List<Equipment> equipmentList) {

    }


}
